package com.kingwang.demo.springsecuritytokendemo.security.sso;

import com.kingwang.demo.springsecuritytokendemo.security.AuthenticationResultCode;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class SsoAuthenticationResult {
    private AuthenticationResultCode code;

    private String username;

    private String displayName;

    private String areaCode;

    private final Map<String, Object> attributes = new HashMap<>();

    public void addAttribute(String name, Object value) {
        this.attributes.put(name, value);
    }

    public void removeAttribute(String name) {
        this.attributes.remove(name);
    }

    public void clearAttributes() {
        this.attributes.clear();
    }
}
